var listTemplate = require('./index.string');
require('../../util/util.js');
var _order_service = require('service/order-service.js');
var _catalog_service = require('service/catalog-service.js');
var _header = require('page/common/header/index.js');
const _util = require('../../util/util');


var order = {
    Data :{
        order:'',
        lineItems:{}
    },
    init :function(){
        this.bindEvents();
        this.loadAccountInfo();
        return this;
    },
    bindEvents : function(){
        
    },
    loadAccountInfo : function(){
        var orderId = _util. getURLParam("orderId");
        console.log(orderId);
        var _this=this;
        _order_service.getOrderByOrderId(orderId,
            function(res){
                _this.Data.order=res;
                var result = _util.renderHtml(listTemplate, {data : _this.Data});
                $('#Catalog').html(result);
            },
            function(){

            }
        );
     }
};

module.exports = order.init();